/**
 * 
 */
package com.wskj.util;

import java.util.List;

/**
 * @author 胡洋
 * @describe  页面的内容 
 * @Date 2018年3月21日上午10:33:38
 * @version 1.0
 */
public class Page<T> {
	
	private  int pageIndex=1;//当前的页面 
	private  int pageSize=10; //每页显示条数 
	private  int totalPage=1; //一共有多少页
	private  long counts=0; //满足查询条件的个数 
	
	private  List<T>  data; //页面显示的数据 ...
	
	

	public Page() {
		super();
	}

	public Page(int pageIndex, int pageSize) {
		super();
		this.pageIndex = pageIndex;
		this.pageSize = pageSize;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	
	public int getTotalPage() {
		return totalPage;
	}


	public long getCounts() {
		return counts;
	}

	public void setCounts(long counts) {
		this.counts = counts;
		//设置多少页....
		if(counts==0) {
		    this.totalPage=1;
		}else {
		  this.totalPage=(int) (counts%pageSize==0?counts/pageSize:counts/pageSize+1);			
		}		
	}

	
	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

}
